package org.example.controller;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import org.example.pojo.Elderly;
import org.example.utils.R;
import org.example.service.ElderlyAnalyzeService;
import com.google.gson.Gson;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: 老人表
 * @Author:曹震
 * @Date: 2024/12/9 9:25
 */
@RestController
@CrossOrigin
@RequestMapping("edlerAnalyze")
public class ElderAnalyzeController {
    @Resource
    private ElderlyAnalyzeService service;
    //根据请求次数来将老人的信息进行展示
    @GetMapping("shorElderly")
    public R sortEdler(){
        R r = service.sortEdler();
        return r;
    }
    //根据老人的id寻找相关信息
    @GetMapping("listElderly")
    public R listElderly(@RequestParam String userId){
       Elderly elderly = service.listElderlyTask(userId);

        return R.successful("nimade", elderly);
    }
    //
    @GetMapping("listElderlyMap")
    public R listElderlyMap(@RequestParam String elderlyId){
        String s = service.listElderlyMap(elderlyId);
        return R.successful(null, s);
    }
}
